package cc.linker.steplink.crm.merchant.controller;

import cc.linker.steplink.crm.merchant.task.AccountSummaryStatisticsTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 定时任务手动调用
 */
@RestController
@RequestMapping("/task")
public class MerchantTaskController {
    private AccountSummaryStatisticsTask accountSummaryStatisticsTask;
    
    @Autowired
    public MerchantTaskController (AccountSummaryStatisticsTask accountSummaryStatisticsTask) {
        this.accountSummaryStatisticsTask = accountSummaryStatisticsTask;
    }

    /**
     * 账单汇总
     * @param day 可选，默认计算昨天
     */
    @GetMapping("/calcAccountSummary")
    public void calcAccountSummary(String day) {
        accountSummaryStatisticsTask.calcAccountSummary(day);
    }

    /**
     * 小b账单汇总
     * @param day 可选，默认计算昨天
     */
    @GetMapping("/calcAccountSummarySaler")
    public void calcAccountSummarySaler(String day) {
        accountSummaryStatisticsTask.calcAccountSummarySaler(day);
    }
    
}
